package com.shangyueshang.enums;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;

/**
 * @author: JokeyZheng
 * @email: zhengjingfeng@ruqimobility.com
 * @created: 2022/1/14 11:14
 * @version: v1.0.0
 */
@AllArgsConstructor
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum UserStatus {
	/**
	 * 禁用
	 */
	disabled(0),
	/**
	 * 启用
	 */
	enabled(1);
	
	public final int val;
	
	public static UserStatus of(int val) {
		UserStatus[] values = values();
		for (UserStatus it : values) {
			if (val == it.val) {
				return it;
			}
		}
		return null;
	}
}
